SRC=./src/ro/pub/cs/pp/pdad/EndReason.java
JAR=endreason.jar
CLASSPATH=../hadoop-0.20.1-core.jar
HADOOP=/usr/local/hadoop/bin/hadoop
BIN=bin
INPUT=/user/hadoop/input/$(APP)/event_trace/event_trace.tab
OUTPUT=/user/hadoop/output/endreason/$(APP)

build: $(JAR)

$(JAR): $(SRC)
	@mkdir $(BIN)
	@javac -cp $(CLASSPATH) -d ./$(BIN) $(SRC)
	@jar -cvf $(JAR) -C ./$(BIN) .

run: $(JAR)
	@$(HADOOP) fs -rmr $(OUTPUT)
	@$(HADOOP) jar ./$(JAR) ro.pub.cs.pp.pdad.EndReason $(INPUT) $(OUTPUT)

clean: 
	rm -rf ./$(BIN)
	rm -f ./$(JAR)
	rm -f ./*~
